/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.hotel.test.service.persistence;

import com.hotel.test.model.Local;

import com.liferay.portal.service.persistence.BasePersistence;

/**
 * The persistence interface for the local service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Vien-IT
 * @see LocalPersistenceImpl
 * @see LocalUtil
 * @generated
 */
public interface LocalPersistence extends BasePersistence<Local> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link LocalUtil} to access the local persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the local in the entity cache if it is enabled.
	*
	* @param local the local
	*/
	public void cacheResult(com.hotel.test.model.Local local);

	/**
	* Caches the locals in the entity cache if it is enabled.
	*
	* @param locals the locals
	*/
	public void cacheResult(java.util.List<com.hotel.test.model.Local> locals);

	/**
	* Creates a new local with the primary key. Does not add the local to the database.
	*
	* @param localId the primary key for the new local
	* @return the new local
	*/
	public com.hotel.test.model.Local create(long localId);

	/**
	* Removes the local with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param localId the primary key of the local
	* @return the local that was removed
	* @throws com.hotel.test.NoSuchLocalException if a local with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.hotel.test.model.Local remove(long localId)
		throws com.hotel.test.NoSuchLocalException,
			com.liferay.portal.kernel.exception.SystemException;

	public com.hotel.test.model.Local updateImpl(
		com.hotel.test.model.Local local, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the local with the primary key or throws a {@link com.hotel.test.NoSuchLocalException} if it could not be found.
	*
	* @param localId the primary key of the local
	* @return the local
	* @throws com.hotel.test.NoSuchLocalException if a local with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.hotel.test.model.Local findByPrimaryKey(long localId)
		throws com.hotel.test.NoSuchLocalException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the local with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param localId the primary key of the local
	* @return the local, or <code>null</code> if a local with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.hotel.test.model.Local fetchByPrimaryKey(long localId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the locals where localName = &#63;.
	*
	* @param localName the local name
	* @return the matching locals
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Local> findByLocalName(
		java.lang.String localName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the locals where localName = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param localName the local name
	* @param start the lower bound of the range of locals
	* @param end the upper bound of the range of locals (not inclusive)
	* @return the range of matching locals
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Local> findByLocalName(
		java.lang.String localName, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the locals where localName = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param localName the local name
	* @param start the lower bound of the range of locals
	* @param end the upper bound of the range of locals (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching locals
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Local> findByLocalName(
		java.lang.String localName, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first local in the ordered set where localName = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param localName the local name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching local
	* @throws com.hotel.test.NoSuchLocalException if a matching local could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.hotel.test.model.Local findByLocalName_First(
		java.lang.String localName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.hotel.test.NoSuchLocalException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last local in the ordered set where localName = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param localName the local name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching local
	* @throws com.hotel.test.NoSuchLocalException if a matching local could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.hotel.test.model.Local findByLocalName_Last(
		java.lang.String localName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.hotel.test.NoSuchLocalException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the locals before and after the current local in the ordered set where localName = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param localId the primary key of the current local
	* @param localName the local name
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next local
	* @throws com.hotel.test.NoSuchLocalException if a local with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.hotel.test.model.Local[] findByLocalName_PrevAndNext(
		long localId, java.lang.String localName,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.hotel.test.NoSuchLocalException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the locals.
	*
	* @return the locals
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Local> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the locals.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of locals
	* @param end the upper bound of the range of locals (not inclusive)
	* @return the range of locals
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Local> findAll(int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the locals.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of locals
	* @param end the upper bound of the range of locals (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of locals
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Local> findAll(int start,
		int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the locals where localName = &#63; from the database.
	*
	* @param localName the local name
	* @throws SystemException if a system exception occurred
	*/
	public void removeByLocalName(java.lang.String localName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the locals from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of locals where localName = &#63;.
	*
	* @param localName the local name
	* @return the number of matching locals
	* @throws SystemException if a system exception occurred
	*/
	public int countByLocalName(java.lang.String localName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of locals.
	*
	* @return the number of locals
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the hotels associated with the local.
	*
	* @param pk the primary key of the local
	* @return the hotels associated with the local
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Hotel> getHotels(long pk)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the hotels associated with the local.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param pk the primary key of the local
	* @param start the lower bound of the range of locals
	* @param end the upper bound of the range of locals (not inclusive)
	* @return the range of hotels associated with the local
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Hotel> getHotels(long pk,
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the hotels associated with the local.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param pk the primary key of the local
	* @param start the lower bound of the range of locals
	* @param end the upper bound of the range of locals (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of hotels associated with the local
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.hotel.test.model.Hotel> getHotels(long pk,
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of hotels associated with the local.
	*
	* @param pk the primary key of the local
	* @return the number of hotels associated with the local
	* @throws SystemException if a system exception occurred
	*/
	public int getHotelsSize(long pk)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns <code>true</code> if the hotel is associated with the local.
	*
	* @param pk the primary key of the local
	* @param hotelPK the primary key of the hotel
	* @return <code>true</code> if the hotel is associated with the local; <code>false</code> otherwise
	* @throws SystemException if a system exception occurred
	*/
	public boolean containsHotel(long pk, long hotelPK)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns <code>true</code> if the local has any hotels associated with it.
	*
	* @param pk the primary key of the local to check for associations with hotels
	* @return <code>true</code> if the local has any hotels associated with it; <code>false</code> otherwise
	* @throws SystemException if a system exception occurred
	*/
	public boolean containsHotels(long pk)
		throws com.liferay.portal.kernel.exception.SystemException;
}